/*
 * @Description: 
 * @Author: yeeChen
 * @Date: 2022-12-21 16:00:34
 * @LastEditTime: 2022-12-21 16:11:53
 * @LastEditors: yeeChen
 */
const express = require('express')
const app = express()

// 通过express.json()的内置中间件可以解析表单的数据
app.use(express.json())
app.use(express.urlencoded())

app.post('/', (req, res) => {
    // 在服务器中可以用req.body属性接受请求的数据
    // 默认情况下，如果不配置表单数据的中间件，则req.body默认=undefined
    console.log(req.body);
    res.send('ok')
})

app.post('/book', (req, res) => {
    console.log(req.body);
    res.send('ok')
})


app.listen(80, function () {
    console.log('express running at http://127.0.0.1');
})



